package com.ufida.ids.util;

import net.sf.json.JSONArray;

public class StringUtil {
	/**
	 * 构建id集合
	 * @param idArr
	 * @return
	 */
	public static String buildIdsStr(JSONArray idArr){
		StringBuffer sb = new StringBuffer();
		sb.append("(");
		for (int j = 0; j < idArr.size(); j++) {
			if(j<idArr.size()-1){
				sb.append(idArr.get(j)).append(",");
			}else{
				sb.append(idArr.get(j));
			}
		}
		sb.append(")");
		return sb.toString();
	}
	
	public static String tranStr(String s) throws Exception{
		String value = new String(s.getBytes("ISO-8859-1"),"UTF-8");
		return value;
	}
	
}
